package principle.dependecy.inversion;

public class ConstructorDependency {

    public static void main(String[] args) {
        PersonTwo personTwo = new PersonTwo(new Email());
        personTwo.recive();
    }

}


class PersonTwo {

    private IReciver reciver;

    public PersonTwo(IReciver reciver) {
        this.reciver = reciver;
    }

    public void recive() {
        reciver.recive();
    }
}